<template>
  <div class="modal-overlay">
    <div class="progress-modal-content">
      <h3 class="title">{{ title }}</h3>
      <p class="message">{{ message }}</p>
      <div class="progress-bar-container">
        <div class="progress-bar" :style="{ width: progress + '%' }"></div>
      </div>
      <span class="progress-text">{{ progress.toFixed(0) }}%</span>
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  title: string;
  message: string;
  progress: number;
}>();
</script>

<style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* 确保在最顶层 */
}
.progress-modal-content {
  background: white;
  padding: 32px 40px;
  border-radius: 8px;
  text-align: center;
  width: 450px;
  max-width: 90%;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}
.title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
}
.message {
  font-size: 1rem;
  color: #6c757d;
  margin: 0 0 24px 0;
}
.progress-bar-container {
  width: 100%;
  height: 16px;
  background-color: #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0d6efd, #0dcaf0);
  border-radius: 8px;
  transition: width 0.3s ease-in-out;
}
.progress-text {
  font-weight: 500;
  color: #495057;
}
</style>
